﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.utils {

    public class Objects {

        public static function getKeys(_arg1:Object):Array{
            var _local3:String;
            var _local2:Array = [];
            for (_local3 in _arg1) {
                _local2.push(_local3);
            };
            return (_local2);
        }
        public static function getValues(_arg1:Object):Array{
            var _local3:Object;
            var _local2:Array = [];
            for each (_local3 in _arg1) {
                _local2.push(_local3);
            };
            return (_local2);
        }
        public static function merge(_arg1:Object, _arg2:Object):Object{
            var _local3:String;
            for (_local3 in _arg1) {
                _arg2[_local3] = _arg1[_local3];
            };
            return (_arg2);
        }
        public static function setValue(_arg1:Object, _arg2:String, _arg3, _arg4:String="/"):void{
            var _local8:String;
            var _local5:Array = _arg2.split(_arg4);
            var _local6:Object = _arg1;
            var _local7:int;
            while (_local7 < _local5.length) {
                _local8 = _local5[_local7];
                if (_local6[_local8] == null){
                    _local6[_local8] = {};
                };
                if (_local7 < (_local5.length - 1)){
                    _local6 = _local6[_local8];
                } else {
                    _local6[_local8] = _arg3;
                };
                _local7++;
            };
        }
        public static function getValue(_arg1:Object, _arg2:String, _arg3:String="/"):Object{
            var _local6:String;
            var _local4:Array = _arg2.split(_arg3);
            var _local5:Object = _arg1;
            for each (_local6 in _local4) {
                if (_local5 != null){
                    _local5 = _local5[_local6];
                } else {
                    return (null);
                };
            };
            return (_local5);
        }
        public static function sumUpValues(_arg1:Object):int{
            var _local3:int;
            var _local2:int;
            for each (_local3 in _arg1) {
                _local2 = (_local2 + _local3);
            };
            return (_local2);
        }

    }
}//package net.wooga.pets.utils 
